import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state:{
    status:'false',
    account:''
  },
  mutations: {
    login(state,account) {
      state.status='true';
      state.account=account;
    },
    logout(state){
      sessionStorage.clear();
      state.status='false';
      state.account='';
    }
  },
  actions: {
    login (context, account) {
      context.commit('login',account)
    },
    logout (context) {
      context.commit('logout')
    }
  },
  modules: {
  }
})
